How to: Refer to a form, report, subform, or subreport in an expression.
Solution:
In the query Design View, use the syntax 'Form or Report ! [Form name or Report Name]' in the desired expression.
1) If the Database window is not active, activate the Database window.
2) Click the 'Queries' tab in the Database window.
Queries tab
3) Select the desired query in the list box. (The selected query is highlighted.)
4) Click 'Design'. (The query appears in Design View.)
5) Position the mouse pointer in the desired cell that contains the expression.
6) To refer to a form or report, do the following:
a) To refer to a form, type the desired identifier using the syntax
Forms![form name]
EXAMPLE: Forms![Orders]
(where [Orders] is the name of the form).
b) To refer to a report, type the desired identifier using the syntax
Reports![Report Name]
EXAMPLE: Reports![Invoice]
(where [Invoice] is the name of the report).
7) To refer to a subform or subreport, do the following:
a) To refer to a subform, type the desired identifier using the syntax
Forms![Form Name]![Subform Name].Form
EXAMPLE: Forms![Orders]![Orders Details].Form
(where [Orders] is the name of the main form and [Orders Details] is the name of the subform).
b) To refer to a subreport, type the desired identifier using the syntax
Reports![Report Name]![Subreport Name].Report
EXAMPLE: Reports![Invoice]![Invoice Per Order].Report
(where [Invoice] is the name of the main report and [Invoice Per Order] is the name of the subreport).